<!DOCTYPE html>
<html>
<head>
    <title>备件明细</title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
    <Card>
        <Tabs value="name5" type="card">
            <Tab-pane label="查看" name="name5">
                <table id="jqGrid3"></table>
            </Tab-pane>
        </Tabs>
    </Card>
</div>

<script>
    var id = getQueryString("id");
    var moduleCode = getQueryString("moduleCode");
    var moduleTypeName = decodeURI(getQueryString("moduleTypeName")) == null || decodeURI(getQueryString("moduleTypeName")) == 'null' ? '' : decodeURI(getQueryString("moduleTypeName"));
    /**
     * 基础信息
     */
    $(function () {
        vm.getInfo()
    });
    /**
     * 维修履历
     */
    $(function () {
        $("#jqGrid3").Grid({
            url: '../modulerepairrocord/list?moduleCode=' + moduleCode,
            colModel: [
                {label: '型芯位置号', name: 'repairCode', index: 'REPAIR_CODE', width: 80},
                {label: '寿命基础', name: 'repairCode', index: 'REPAIR_CODE', width: 80},
                {label: '12/31', name: 'repairCode', index: 'REPAIR_CODE', width: 80},
                {label: '1/1', name: 'repairCode', index: 'REPAIR_CODE', width: 80},
                {label: '1/2', name: 'repairCode', index: 'REPAIR_CODE', width: 80},
                {label: '1/3', name: 'repairCode', index: 'REPAIR_CODE', width: 80},
                {label: '1/4', name: 'repairCode', index: 'REPAIR_CODE', width: 80},
                {label: '1/5', name: 'repairCode', index: 'REPAIR_CODE', width: 80},
                {label: '1/6', name: 'repairCode', index: 'REPAIR_CODE', width: 80},
                {label: '1/7', name: 'repairCode', index: 'REPAIR_CODE', width: 80},
                {label: '1/8', name: 'repairCode', index: 'REPAIR_CODE', width: 80},
                {label: '1/9', name: 'repairCode', index: 'REPAIR_CODE', width: 80},
                {label: '1/10', name: 'repairCode', index: 'REPAIR_CODE', width: 80},
                {label: '1/11', name: 'repairCode', index: 'REPAIR_CODE', width: 80},
                {label: '1/12', name: 'repairCode', index: 'REPAIR_CODE', width: 80},
            ]
        });
    });
    let vm = new Vue({
        el: '#rrapp',
        data: {
            q: {
                name: ''
            },

            moduleArchives: {},
        },
        methods: {
            getInfo: function () {
                Ajax.request({
                    url: "../modulearchives/info/" + id,
                    async: true,
                    successCallback: function (r) {
                        console.log(
                            r.moduleArchives
                        )
                        vm.moduleArchives = r.moduleArchives;
                        vm.moduleArchives.startDate = transDate(r.moduleArchives.startDate, 'yyyy-MM-dd');
                        vm.moduleArchives.currentState =sysEnums.MODULE_STATE[r.moduleArchives.currentState];
                        vm.moduleArchives.moduleCategory = sysEnums.MODULE_TYPE[r.moduleArchives.moduleCategory];
                        console.log(vm.moduleArchives)
                    }
                });
            },
            eyeFile: function (url) {
                if (url) {
                    window.open(url);
                } else {
                    alert('还未上传文件');
                }
            }
        }
    });
</script>
</body>
</html>
